//我？写出T1？真的假的？
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
const int N = 1e5+5;
int n;
int a[N], b[N];
int cnt;
int maxn = -1;
int minn = 1e5;
int ans;
int main(){
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    cin >> n;
    for(int i = 1; i <= n; i++){
        cin >> a[i];
        b[a[i]]++;
        maxn = max(maxn, a[i]);
        minn = min(minn, a[i]);
    }
    sort(a + 1, a + n + 1);
    for(int i = 1; i <= maxn; i++){
        if(b[i] != 0 && i != minn){
            if(b[i] > b[minn]){
                b[minn] = 0;
                b[i] -= b[minn];
                minn = i; 
            } else {
                b[i] = 0;
                b[minn] -= b[i];
            }
        }
    }
    for(int i = 1; i <= maxn; i++)
        ans += b[i];
    cout << ans << endl;
    return 0;
}